<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>接口数据展示（使用fetch）</title>
</head>

<body>
<div>test</div>
<div id="result"></div>
<script>
    // 使用fetch来发起请求
    fetch('https://65bu0pybuwvuns9m1f.api-drcn.agconnect.link/')
       .then(response => response.json())
       .then(data => {
            var resultDiv = document.getElementById('result');
            var p = document.createElement('p');
            p.textContent = '标题: ' + data.errorCode + ', 内容: ' + data.message;
            resultDiv.appendChild(p);
        })
       .catch(error => console.error('请求出错：', error));
</script>
</body>

</html>